Write down the conventions the codebase already follows - #62
Open
setusher wants to merge 1 commit into
Open
Conversation
Nothing recorded how a change to Omniport is expected to be written, so every contributor rediscovered it from whichever files they happened to read, and reviews spent their time on style rather than on substance. omniport-backend#222 is the clearest statement of the conventions in the history. Four of its twenty commits do nothing but bring comments and docstrings back into line, and the reason it gives is the rule the rest of them follow: the reasoning behind a change belongs in its commit message rather than beside the code. Every rule here is that applied somewhere, and each one cites the commit it comes from, so a reader who disagrees can go and read the change rather than argue with a document. The pull request headings are the five already used by .github/pull_request_template.md, written out with what each is for. CONTRIBUTING.md rather than a wiki page, because GitHub links it from the pull request and issue forms of the repository it sits in, and because a convention that is not in the tree goes stale without anyone noticing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
CONTRIBUTING.md, recording the conventions this codebase already follows for pull request descriptions, commit messages, comments, docstrings and constants. Every rule cites the commit inomniport-backend#222it is drawn from.Issue
Nothing in the tree records how a change to Omniport is expected to be written. The conventions exist and are followed consistently, but only in the history, so each contributor rediscovers them from whichever files they happen to open and reviews spend their time on style rather than on substance.
The clearest statement of them is
omniport-backend#222. Four of its twenty commits do nothing but bring comments and docstrings back into line, and26d6d1agives the reason the rest of them follow:That is one rule, and most of the others are it applied somewhere. It is not written down anywhere a contributor would find it.
Steps to reproduce the bug/issue
Not reproducible at runtime, so here is the evidence in the tree instead.
No conventions document exists in any Omniport repository:
CODE_OF_CONDUCT.mdis the only governance file, and it covers behaviour rather than code.The conventions are nonetheless real and consistent. Every subject line in
#222is imperative, sentence case, no prefix, no ticket number:And they are enforced by hand, after the fact, which is the cost of not writing them down.
#222contains four separate cleanup commits doing it:79f4a68,2776810,26d6d1a,ff40f42.Steps done to fix it and test added for the same
CONTRIBUTING.mdcovers, in this order: the pull request description, commits, comments, docstrings, constants, code and prose.The rules are taken from the history rather than invented, and each cites its commit so a reader who disagrees can go and read the change:
26d6d1a26d6d1a# ALWAYS return identical response - CRITICAL ...became# The same response either way, so that accounts cannot be enumeratedff40f4279f4a68SECURITY FIXESblock cut to two lines79f4a68dcc00d05830ac1The pull request headings are the five
.github/pull_request_template.mdalready uses, written out with what each section is for, plus the rule that a test has to run in CI and be observed failing before it is believed.No test is added, and that is a deliberate choice worth stating. Almost nothing here is mechanically checkable: whether a comment explains the why rather than the what, or whether a commit body names the mechanism, is a judgement. Adding a linter that checks the two rules which are mechanical, the em dash and the subject line shape, would give the impression the rest are enforced too. The document says so itself, and prefers a mechanical check wherever the property allows one.
What was done instead is check the document against its own rules, which found two failures and fixed both:
A style guide that breaks its own rules gets ignored.
Criteria for issue to be resolved
CONTRIBUTING.mdis at the repository root, where GitHub links it from the pull request and issue formsomniport-backend:dcc00d0,4164fc0,ff40f42,26d6d1a,79f4a68,5830ac1.github/pull_request_template.mdexactly#222Scope
This lands in
omniport-dockeralone, as the repository every contributor already has checked out, rather than being copied into all ninety-odd repositories where it would drift. If it should also sit inomniport-backend, where#222actually lives, that is a one-file follow-up.The
Co-Authored-Bytrailer that every commit in#222carries is not written down as a convention here, deliberately. It is house practice by the evidence, but attribution is a policy question rather than a style one, and this document should not be the place it gets settled.